#include<func.h>
int main(int argc,char* argv[])
{
    ARGS_CHECK(argc,3)
    int sfd;
    sfd=socket(AF_INET,SOCK_STREAM,0);
    ERROR_CHECK(sfd,-1,"socket")
    printf("sfd=%d\n",sfd);
    struct sockaddr_in ser_addr;
    bzero(&ser_addr,sizeof(ser_addr));
    ser_addr.sin_family=AF_INET;
    ser_addr.sin_addr.s_addr=inet_addr(argv[1]);
    ser_addr.sin_port=htons(atoi(argv[2]));
    int ret=connect(sfd,(struct sockaddr*)&ser_addr,sizeof(ser_addr));
    ERROR_CHECK(ret,-1,"connect")
    ret=send(sfd,"hello",5,0);
    ERROR_CHECK(ret,-1,"send")
    char buf[128]={0};
    ret=recv(sfd,buf,sizeof(buf),0);
    printf("I am client,gets=%s\n",buf);
    close(sfd);

}